<!DOCTYPE HTML>
<html lang="en">
<head>
    <meta charset='UTF-8' />
    <title>三鑫-灯世界网销平台</title>
    <!--<meta name="full-screen" content="yes">-->
    <!--<meta name="x5-fullscreen" content="true">-->
    <!--<meta name="browsermode" content="application">-->
    <!--<meta name="x5-page-mode" content="app">-->
    <meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no,minimal-ui">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="stylesheet" href="__PUBLIC__/phone/css/styles.css" />
    <link rel="stylesheet" href="__PUBLIC__/phone/css/mui.min.css">
    <script src=""></script>
    <script src="__PUBLIC__/js/jquery.min.js"></script>
    <script src="__PUBLIC__/phone/js/mui.min.js"></script>
    <link rel="stylesheet" href="__PUBLIC__/phone/css/index.css" />
    <style type="text/css">
        .mui-slider img{height: 120px;}
    </style>
</head>
<body class="bg">
<!--公共搜索栏-->
<include file="./phone/Home/View/Public/search.html"/>
<script type="text/javascript">
    addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false);
    function hideURLbar(){
        window.scrollTo(0,1);
    }
</script>
<div id="pullrefresh" class="mui-content mui-scroll-wrapper" style="top:48px">
    <div class="mui-scroll" style="background-color: white">
        <!--轮播图-->
        <div class="mui-slider">
            <div class="mui-slider-group mui-slider-loop">
                <!--支持循环，需要重复图片节点-->
                <volist name="picture" id="pi" key="k">
                    <if condition="$k eq 3">
                        <div class="mui-slider-item mui-slider-item-duplicate">
                            <a href="#"><img src="__ROOT__{$pi.lb_picture}" /></a>
                        </div>
                    </if>
                </volist>
                <volist name="picture" id="pi" key="k">
                    <div class="mui-slider-item"><a href="#"><img src="__ROOT__{$pi.lb_picture}" /></a></div>
                </volist>
                <volist name="picture" id="pi" key="k">
                    <if condition="$k eq 1">
                        <!--支持循环，需要重复图片节点-->
                        <div class="mui-slider-item mui-slider-item-duplicate"><a href="#"><img src="__ROOT__{$pi.lb_picture}" /></a></div>
                    </if>
                </volist>
            </div>
        </div>
        <script type="text/javascript">
            var slider = mui(".mui-slider");
            slider.slider({
                interval: 1000
            });
        </script>
        <div style="text-align: center;color: #e6223c;width: 100%;height: 24px;line-height: 24px;">
        	<div style="float: left;width: 30%;border-top: 1px solid #DDDDDD;height: 0;margin-top: 10px;margin-left: 5%;">&nbsp;</div>
        	<div style="float: left;width: 30%;font-size: 13px">新品推荐</div>
        	<div style="float: left;width: 30%;border-top: 1px solid #DDDDDD;height: 0;margin-top: 10px;">&nbsp;</div>
        </div>
        <div style="clear: both;"></div>
        <!--数据列表-->
        <ul class="mui-table-view pt-list" style="padding-bottom: 40px">
            <volist name="list" id="li">
                <a class="lista" href="{:U('goods_details')}?goods_id={$li.good_id}">
                    <img src="__ROOT__{$li.picture}" style="width: 100%;">
                    <p>{$li.good_name}</p>
                    <p>
                        <if condition="session('vip') eq 1">
                            <span style="color: #e6223c;text-decoration: line-through;">￥{$li.price}</span>
                            <span style="color: #e6223c;">￥{$li.vip_price}</span>
                            <else/>
                            <span style="float: left">￥{$li.price}</span>
                        </if>
                    </p>
                </a>
            </volist>
        </ul>
    </div>
</div>
<input type="hidden" id="pages" value="2">
<a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=2675162351&site=qq&menu=yes">
    <img border="0" src="http://wpa.qq.com/pa?p=2:2675162351:51" alt="联系客服" title="联系客服"/></a>
<script>
    mui.init({
        pullRefresh: {
            container: '#pullrefresh',
//            down: {
//                callback: pulldownRefresh
//            },
            up: {
                contentrefresh: '正在加载...',
                callback: pullupRefresh
            }
        }
    });
    /**
     * 下拉刷新具体业务实现
     */
//    function pulldownRefresh() {
//        setTimeout(function() {
//            mui('#pullrefresh').pullRefresh().endPullupToRefresh(false);
//            location.href=location.href
//        }, 1500);
//    }
    var pages = $('#pages').val();
    /**
     * 上拉加载具体业务实现
     */
    function pullupRefresh() {
        setTimeout(function() {
            $.ajax({
                url:"{:U('upData')}",
                data:{'page':pages},
                type:'post',
                success:function (e) {
                    if(e == -1){
                        mui('#pullrefresh').pullRefresh().endPullupToRefresh(true); //参数为true代表没有更多数据了。
                    }else{
                        var da = JSON.parse(e);
                        var repaly = '';
                        for (var i=0;i<da.length;i++){
                            repaly += '<a class="lista" href="{:U(goods_details)}?goods_id='+da[i].good_id+'">'
                                    +'<img src="__ROOT__'+da[i].picture+'" style="width: 100%;">'
                                    +'<p>'+da[i].good_name+'</p>'
                                    +'<p>'
                                    +'<if condition="session(vip) eq 1">'
                                    +'<span style="color: #e6223c;text-decoration: line-through;">￥'+da[i].price+'</span>'
                                    +'<span style="color: #e6223c;">￥'+da[i].vip_price+'</span>'
                                    +'<else/>'
                                    +'<span style="float: left">￥'+da[i].price+'</span>'
                                    +'</if>'
                                    +'</p></a>';
                        }
                        mui('#pullrefresh').pullRefresh().endPullupToRefresh(false); //参数为true代表没有更多数据了。
                        $('.pt-list').append(repaly);
                        pages++;
                        $('#page').val(pages);
                    }

                }
            });
        }, 300);
    }

    mui('body').on('tap','a',function(){
        window.top.location.href=this.href;
    });
</script>
<!--公共底部-->
<include file="./phone/Home/View/Public/foot.html"/>

</body>
</html>